package com.ce.server.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ce.server.common.RespPageBean;
import com.ce.server.pojo.Role;
import com.ce.server.pojo.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 郑爽
 * @since 2021-11-17
 */

public interface StudentMapper extends BaseMapper<Student> {

  /**
   * 获取所有的学号
   * @return
   */
  List<String> getAllSno();

  /**
   * 根据学生账号查询角色
   *
   * @param sno
   * @return
   */
  List<Role> getRoleBySno(String sno);


  /**
   * 分页查询学生账号信息
   *
   * @param page
   * @param student
   * @param dateScope
   * @return
   */
  IPage<Student> getStudentsByPage(@Param("page") Page<Student> page, @Param("student") Student student);


  /**
   * 根据
   * @param sno
   * @return
   */
  Student getStudentBySno(String sno);

  /**
   * 更新当前登录用户信息
   * @param student
   * @return
   */
  boolean updateAccountInfo(Student student);
}
